package kr.ac.kongju.gedl.intro.web;

import java.util.Date;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import kr.ac.kongju.gedl.board.service.BoardContentsService;
import kr.ac.kongju.gedl.board.vo.ContentsVO;
import kr.ac.kongju.gedl.cmmn.web.CU;
import kr.ac.kongju.gedl.code.service.CodeService;
import kr.ac.kongju.gedl.code.vo.CodeInfoVO;
import kr.ac.kongju.gedl.common.util.DateUtil;
import kr.ac.kongju.gedl.common.util.ListResultVO;
import kr.ac.kongju.gedl.item.vo.ItemLevelVO;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.support.SessionStatus;

import egovframework.rte.fdl.property.EgovPropertyService;

@Controller
public class IntroController {
	
	/** EgovPropertyService */
    @Resource(name = "propertiesService")
    protected EgovPropertyService propertiesService;
    
    @Resource(name = "reportService")
    protected BoardContentsService errorReportService;

    
    @Resource(name = "codeService")
    protected CodeService codeService;
    
    
    private static final String DEFAULT_SORT = "error_report_id";
    private static final String DEFAULT_DIR = "desc";
    
	
	
	@RequestMapping(value="/intro.do")
	public String selectIntro(@RequestParam(value="page", required=true, defaultValue = "0") String page, 
    		ModelMap model, SessionStatus status,
			HttpSession session) throws Exception {
		String pageUrl = "";
		switch(Integer.parseInt(page)) {
		case 1 :
			pageUrl = "/intro/research";
			break;
		case 2 :
			pageUrl = "/intro/culture";
			break;
		case 3 :
			pageUrl = "/intro/agreement";
			break;
		case 4 :
			//model.addAttribute("idxList", CU.getInstance().getCodeList("IDX"));
			pageUrl = "/intro/sitemap";
			break;
			default :
				pageUrl = "/intro/business";
		}
		
		return pageUrl;
	}
	
	@RequestMapping(value="/wrice.do")
	public String selectWrice(@RequestParam(value="page", required=true, defaultValue = "1") String page, 
    		ModelMap model, SessionStatus status,
			HttpSession session) throws Exception {
		
		model.addAttribute("page", page);
		
		return "/wrice/wrice";
	}
	
	
}
